#ifndef OCTREE_H_INCLUDED
#define OCTREE_H_INCLUDED

namespace engine {

	namespace scene {
			
		class SceneNode;
		
		class OctreeNode {
			private: 
				list<shared_ptr<SceneNode> > m_AttachedNodes;
				vector<shared_ptr<OctreeNode> > m_Children;
				list<shared_ptr<WorldMeshPolygon> > m_Polygons;
				
				AABB m_Bounds;
			public:	
			
				void attachPolygon(shared_ptr<WorldMeshPolygon> newPoly);
				void attachSceneNode(shared_ptr<SceneNode> newNode);
				const AABB& getBounds() const;
		};
		
		class Octree {
			private:
				shared_ptr<OctreeNode> m_RootNode;
				
			public:
				bool buildOctree(const WorldMesh& mesh);

		};
	}
	
}

#endif // OCTREE_H_INCLUDED
